home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
c
/
bitstrg.zip
/
LSETBIT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1989-05-24
|
593b
|
34 lines
/*
librairie : bitstrg
lsetbit -- mise a 1l d'un bit
Le parametre nombre de bits est de type unsigned long
Attention : en Small Memory Model le champ Data est limite a 64Koctets
*/
#include "bitstrg.h"
/*
Set specified bit
if bit > map size, 0 is returned, else 1 is returned
*/
unsigned lsetbit(ptr,bit)
struct LSPARRAY * ptr; /* pointer on structure */
unsigned long bit; /* bit number */
{
if(ptr->numlbit < bit) {
return(0);
}
/* OR original with 1 */
(ptr->pntarray)[bit / SIZE] |= (1 << (bit & (SIZE - 1)));
return(1);
}